<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>create_virtual_host (Speedy::LinuxDeployment)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File lib/speedy/linux_deployment.rb, line 51</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_virtual_host</span>
      <span class="ruby-identifier">apache_touch_file</span> = <span class="ruby-identifier">construct_apache_touch_file</span>
      <span class="ruby-identifier">virtual_host_exists?</span>(<span class="ruby-identifier">apache_touch_file</span>)
      <span class="ruby-identifier">document_root</span> = <span class="ruby-identifier">construct_document_root</span>
      <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>( <span class="ruby-identifier">apache_touch_file</span>, <span class="ruby-value str">'w'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">file</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;&lt;VirtualHost *:80&gt;\n&quot;</span>
        <span class="ruby-identifier">file</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\tServerName #{@app_name}\n&quot;</span>
        <span class="ruby-identifier">file</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\tRailsEnv development\n&quot;</span>
        <span class="ruby-identifier">file</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\tDocumentRoot #{document_root}\n&quot;</span>
        <span class="ruby-identifier">file</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;&lt;/VirtualHost&gt;&quot;</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\n\nVirtual Host for #{@app_name} created.\n&quot;</span>
    <span class="ruby-keyword kw">end</span></pre>
</body>
</html>